package com.xiyin.controller;


import com.xiyin.entity.UserOrderView;
import com.xiyin.service.impl.UserOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/user-orders")
public class UserOrderController {

    private final UserOrderService userOrderService;

    @Autowired
    public UserOrderController(UserOrderService userOrderService) {
        this.userOrderService = userOrderService;
    }

    /**
     * 视图调用
     * @Date 2024/8/29 10:02
     **/
    @GetMapping
    public List<UserOrderView> getAllUserOrders() {
        return userOrderService.getAllUserOrders();
    }
}
